#include <QtCore/QTextCodec>

#include <QtGui/QApplication>
#include <QtGui/QFont>
#include <QtGui/QStyle>
#include <QtGui/QWindowsVistaStyle>

#include "database_connection.h"
#include "mainui.h"
#include "global.h"



int main(int argc, char*argv[])
{
    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF8"));
    QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF8"));
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF8"));


    QApplication app(argc, argv);
    if (!createConnection("loc_inf.db"))
    {
        return 1;
    }

    app.setStyle(new QWindowsStyle);
    QFont sys_font = app.font();
    sys_font.setPixelSize(10);
    app.setFont(sys_font);

    SysMode::Instance()->setMode(SysMode::FULL_MODE);

    MainUI w;
    w.show();

    return app.exec();
}
